home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / ttf-opensymbol.postinst < prev    next >
Encoding:
Text File  |  2007-04-10  |  2.1 KB  |  81 lines

  1. #!/bin/sh
  2.  
  3. # postinst script for ttf-opensymbol
  4.  
  5. THIS_PACKAGE=ttf-opensymbol
  6. THIS_SCRIPT=postinst
  7.  
  8. set -e
  9.  
  10. LIBSUFFIX=li
  11. # vim:set ai et sts=2 sw=2 tw=0:
  12.  
  13. # Query the terminal to establish a default number of columns to use for
  14. # displaying messages to the user.  This is used only as a fallback in the
  15. # event the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while
  16. # the script is running, and this cannot, only being calculated once.)
  17. DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
  18. if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
  19.   DEFCOLUMNS=80
  20. fi
  21.  
  22. message() {
  23.     echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
  24. }
  25.  
  26. # Prepare to move a conffile without triggering a dpkg question
  27. prep_rm_conffile() {
  28.     CONFFILE="$1"
  29.  
  30.     if [ -e "$CONFFILE" ]; then
  31.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  32.         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
  33.         if [ "$md5sum" = "$old_md5sum" ]; then
  34.             mv "$CONFFILE" "$CONFFILE.${THIS_PACKAGE}-tmp"
  35.         fi
  36.     fi
  37. }
  38.  
  39. rm_conffile_commit() {
  40.   CONFFILE="$1"
  41.  
  42.   if [ -e $CONFFILE.${THIS_PACKAGE}-tmp ]; then
  43.     rm $CONFFILE.${THIS_PACKAGE}-tmp
  44.   fi
  45. }
  46.  
  47. # Remove a no-longer used conffile
  48. rm_conffile() {
  49.     CONFFILE="$1"
  50.  
  51.     if [ -e "$CONFFILE" ]; then
  52.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  53.         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
  54.         if [ "$md5sum" != "$old_md5sum" ]; then
  55.             echo "Obsolete conffile $CONFFILE has been modified by you."
  56.             echo "Saving as $CONFFILE.dpkg-bak ..."
  57.             mv -f "$CONFFILE" "$CONFFILE".bak
  58.         else
  59.             echo "Removing obsolete conffile $CONFFILE ..."
  60.             rm -f "$CONFFILE"
  61.         fi
  62.     fi
  63. }
  64.  
  65. trap "message;\
  66.       message \"Received signal.  Aborting script $0.\";\
  67.       message;\
  68.       exit 1" 1 2 3 15
  69.  
  70. VER=
  71.  
  72.  
  73. if [ "$1" = "configure" ] && [ -x /usr/bin/fc-cache ] && [ -e /etc/fonts/fonts.conf ]; then
  74.     echo "Updating fontconfig cache..."
  75.     fc-cache -fs
  76. fi
  77.  
  78.  
  79.  
  80. exit 0
  81.